<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page isELIgnored="false"%>
<jsp:include page="../frame/header.jsp"></jsp:include>

<title>共享资料上传</title>
</head>

<body>
	<div class="container-fluid">
		<div class="row-fluid">
			<div>
				<ul class="breadcrumb">
					<li><a href="#">学术讨论</a> <span class="divider">/</span></li>
					<li><a href="#">共享资料</a></li>
				</ul>
			</div>

			<div class="box">
				<div class="box-header well" data-original-title>
					<h2>
						<i class="icon-edit"></i> 上传学习文件
					</h2>
					<div class="box-icon">
						<a href="#" class="btn btn-setting btn-round"><i
							class="icon-cog"></i></a> <a href="#"
							class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						<a href="#" class="btn btn-close btn-round"><i
							class="icon-remove"></i></a>
					</div>
				</div>
				<div class="box-content">
					<form id="myform" class="form-horizontal" method="post" action="<c:url value="/admin/study/attach" />">
						<fieldset>
							<input type="hidden" name="attachmentId" value="${attach.attachmentId }">
							<div class="control-group">
								<label class="control-label" for="title">学习小组</label>
								<div class="controls">
									<select data-placeholder="全部" id="sorts_0" name="sortId" data-rel="chosen">
								<option value="0">全部</option>
								
							</select>
							
							<select data-placeholder="全部" id="forumId" name="forumId" data-rel="chosen">
								<option value="0">全部</option>
								
							</select>
								</div>
								
							</div>
							<div class="control-group">
								<label class="control-label" for="title">标题</label>
								<div class="controls">
									<input class="input-xxlarge focused" name="title" check-type="required" required-message="请输入标题"
										id="title" type="text" value="${simple.title }" >
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="weblink">官方地址</label>
								<div class="controls">
									<input class="input-xxlarge" id="weblink" name="weblink" type="text"
										value="${simple.weblink }" placeholder="https://www.eticketing.co.uk/muticketsandmembership/default.aspx">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="description_mc">简介 </label>
								<div class="controls">
									<textarea rows="6" name="description_mc" class="input-xxlarge">${simple.description_mc }</textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label" for="details">详细描述</label>
								<div class="controls">
									<textarea id="details" name="details" rows="30"
										style="width: 95%" class="xheditor">${simple.details }</textarea>
								</div>
							</div>
							<div class="form-actions">
								<button id="saveBtn" type="button" class="btn btn-primary">保存</button>
								<button id="cancelBtn" type="button" class="btn">返回</button>
							</div>
						</fieldset>
					</form>

				</div>
			</div>
			<!--/span-->

		</div>
	</div>
	<!--/row-->
</body>

<jsp:include page="../frame/scripts.jsp"></jsp:include>
<script type="text/javascript">
$(document).ready(function(){
	$('#cancelBtn').click(function(){
		window.location.href = '<c:url value="/admin/live/live_simple" />';	
	})
	
	$("#myform").validation();
	
	//保存
	$('#saveBtn').click(function(){
		if($("#sortId").val() == null){
			alert("请首先创建属于综合类信息的分类！");
			return;
		}
		$("#myform").submit();
	})
	
})
</script>